// 混入 (mixin) 提供了一种非常灵活的方式，来分发 Vue 组件中的可复用功能
// 一个混入对象可以包含任意组件选项
// Vue.minxi   全局混入 
// mixins  局部混入
// Vuex + Mixins 
import Vue from 'vue'
import {
  mapState,
  mapMutations
} from "vuex"
import {
  getCookie,
  setCookie,
  delCookie
} from './cookie'
import {
  FootList
} from './index'
import {
  reg
} from '@/utils/validata'
import {
  ShowError,
  ShowSuccess
} from '@/api/request'
Vue.mixin({
  data() {
    return {
      QQqianming: "心脏中枪",
      FootList: FootList,
      biaoqiannum: 5,
      reg,
    }
  },
  computed: {
    ...mapState([
      'userInfo',
      'city',
      'cityList',
    ]) //属性接收vuex里的userInfo
  },
  created() {

  },
  methods: {
    getCookie,
    setCookie,
    delCookie,
    ShowError,
    ShowSuccess,
    ...mapMutations([
      'chageUserInfo',
      'changeCity',
      'changeCityList'
    ]), //方法接收vuex里chageUserInfo
    tiao(name) {
      this.$router.push({
        name
      })
    }
  },
  mounted() {
    // console.log("全局混入的 mounted ") 
  },
  watch: {

  },
})
